package com.example.rbac.init;

import com.example.rbac.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class PermissionInitializer implements ApplicationRunner {
    
    @Autowired
    private PermissionService permissionService;
    
    @Override
    public void run(ApplicationArguments args) {
        // 在项目启动时初始化接口权限信息
        permissionService.initPermissions();
    }
}